﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using LinqtoCRM.Tests.CRM;

namespace LinqtoCRM.Tests
{
    [TestFixture]
    public class QueryProviderTests : LinqtoCRMTests
    {
        [Test]
        public void TestCreateQuery()
        {
            var contacts = from c in provider.Linq<contact>()
                           select c;
            var a = (provider as IQueryProvider).CreateQuery(contacts.Expression);
            Assert.AreEqual(contacts.Expression, a.Expression);
        }

        [Test]
        public void TestCreateGenericQuery()
        {
            var contacts = from c in provider.Linq<contact>()
                           select c;
            var a = (provider as IQueryProvider).CreateQuery<contact>(contacts.Expression);
            Assert.AreEqual(contacts.Expression, a.Expression);
        }

    }
}
